#define PC

using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Storage;
using Microsoft.Xna.Framework.Content;

namespace TimeWar.Objects
{
    /// <summary>
    /// This is a game component that implements IUpdateable.
    /// </summary>
    public class GameCursor : Microsoft.Xna.Framework.GameComponent
    {

        private int playerSide;
        private Game timeWarGameObj;
        private Texture2D mapCursor;
        private Vector2 cursorPos;

        public GameCursor(Game game, int selectedSide)
            : base(game)
        {
            // TODO: Construct any child components here
            playerSide = selectedSide;
            timeWarGameObj = game;
            cursorPos = new Vector2();

#if PC
            cursorPos.X = Mouse.GetState().X;
            cursorPos.Y = Mouse.GetState().Y;
#endif

        }

        public void setPlayerSide(int side)
        {
            playerSide = side;
        }

        /// <summary>
        /// Allows the game component to perform any initialization it needs to before starting
        /// to run.  This is where it can query for any required services and load content.
        /// </summary>
        public override void Initialize()
        {
            // TODO: Add your initialization code here

            base.Initialize();
        }

        /// <summary>
        /// Allows the game component to update itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        public override void Update(GameTime gameTime)
        {
            // TODO: Add your update code here

            base.Update(gameTime);
        }

        public void LoadContent()
        {
            mapCursor = timeWarGameObj.Content.Load<Texture2D>(".\\Cursors\\tardis");


        }

        public void Draw(GraphicsDeviceManager graphics, GameTime gameTime, SpriteBatch gameSpriteBatch)
        {

#if PC
            cursorPos.X = Mouse.GetState().X;
            cursorPos.Y = Mouse.GetState().Y;
#endif

            gameSpriteBatch.Draw(mapCursor, cursorPos, Color.White);

        }

        public Vector2 getCurrLocation()
        {
            return cursorPos;

        }

        public void setCursorLocation(float X, float Y)
        {
            cursorPos.X = X;
            cursorPos.Y = Y;
        }


    }
}